/*
 ============================================================================
 Name        : debug.h
 Author      :
 Version     :
 Copyright   : Your copyright notice
 Description : Allows controlled debugging and correct application development
 ============================================================================
 */

#ifndef DEBUG_H_
#define DEBUG_H_

//#include <config.h>
#include <config.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define DEBUG_ALL 1 ///< Debug all process
#define DEBUG_INS_TAG 1 ///< Debug instruction tag
#define DEBUG_INS_PROPERTIES 1 ///< Debug instruction properties
#define DEBUG_INS_OPCODE_ATTRIBUTES 1 ///< Debug operation codes attributes

#define DEBUG_ELF_HEADER_PROCESS 1 ///< Debug ELF header process

#define DEBUG_DECODE_NEXT_INSTRUCTION 1 ///< Debug next instruction


#ifdef DEBUG_TRACE_EN
#define PRINT_DEBUG(x,fmt, args...) if(x)printf("%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__, args)
///Displays debug messages according to the mode set for it.
#else
#define PRINT_DEBUG(fmt, args...)
#endif

void PRINT_ERROR(const char *, ...);

#define STATUS_ERROR	1 ///<Response code when a process was run efficiently
#define STATUS_SUCCESS	0 ///<Response code when a process has performed an error in its execution
#define ERROR(x) (x!=0)
#define ERROR_HANDLE(x) if(ERROR(x)){fprintf(stderr,"Wrong use of program!!!\n");exit(EXIT_FAILURE);} ///<Error during execution of the program, it stops running
#endif /* DEBUG_H_ */
